﻿@model Himall.Web.Models.ShopGradeModel

@{
    ViewBag.Title = "Add";
}
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
<script type="text/javascript">

    $(function () {
        $("#Name").focus();
        $("#shopGSubmit").click(function () {
        });
    });
</script>

<div class="container">
    <ul class="nav nav-tabs-custom clearfix">
        <strong>店铺套餐</strong>
        <li><a href="./Management">管理</a></li>
        <li class="active"><a>新增</a></li>
        <em class="primary-btn">
            <span class="glyphicon glyphicon-question-sign"></span>
            <div class="primary">
                <h3>温馨提示：</h3>
                <span>*</span><p>添加店铺套餐</p>
            </div>
        </em>
    </ul>
    @using (Html.BeginForm("Add", "ShopGrade", new { Area = "Admin" }, FormMethod.Post, new { id = "ShopGradeForm" }))
    {
        <div class="form-horizontal">
            <div class="form-group">
            
                <label class="col-sm-2 control-label" for="">套餐名称：</label>
                <div class="col-sm-3">@Html.EditorFor(s => s.Name, new { htmlAttributes = new { @class = "form-control input-sm" } })</div>
                <div class="col-sm-3">@Html.ValidationMessageFor(s => s.Name, "", new { @class = "help-default cor-red" })</div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="">可发布商品数：</label>
                <div class="col-sm-3">@Html.EditorFor(s => s.ProductLimit, new { htmlAttributes = new { @class = "form-control input-sm" } })</div>
                <div class="col-sm-3">@Html.ValidationMessageFor(s => s.ProductLimit, "", new { @class = "help-default cor-red" })</div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="">可用空间（M）：</label>
                <div class="col-sm-3">@Html.EditorFor(s => s.ImageLimit, new { htmlAttributes = new { @class = "form-control input-sm" } })</div>
                <div class="col-sm-3">@Html.ValidationMessageFor(s => s.ImageLimit, "", new { @class = "help-default cor-red" })</div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="">年费：</label>
                <div class="col-sm-3">@Html.EditorFor(s => s.ChargeStandard, new { htmlAttributes = new { @class = "form-control input-sm" } })</div>
                <div class="col-sm-3">元 &nbsp;&nbsp; @Html.ValidationMessageFor(s => s.ChargeStandard, "", new { @class = "help-default cor-red" })</div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary" id="shopGSubmit">保 存</button>
                </div>
            </div>
        </div>
    }

</div>

@*<script>
    $(function () {
        $('#Name').blur(function () {
            var name = $.trim($('#Name').val());
            var reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
            if (!name) {
                $("#nameTip").text("请输入关联板式的名称！");
                $('input[name="name"]').css({ border: '1px solid #f60' });
                $('input[name="name"]').focus();
                return false;
            }
            if (reg.test(name) == false) {
                $("#nameTip").text("名称必须是中文，字母，数字！");
                $('input[name="name"]').css({ border: '1px solid #f60' });
                $('input[name="name"]').focus();
                return false;
            }

            if (name.length > 30) {
                $("#nameTip").text("名称最多只能输入30个字符！");
                $('input[name="name"]').css({ border: '1px solid #f60' });
                $('input[name="name"]').focus();
                return false;
            }
            else {
                $("#nameTip").text("");
                $('input[name="name"]').css({ border: '1px solid #ccc' });
            }
        })
    })
</script>*@
